﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Component;
using DevExpress.Xpo;

public partial class BackEnd_AdminDisplay_DetailCart_DetailCart : System.Web.UI.Page
{
    int _IdCart = 0;
    public string _Session = "";
    public string _tableCart = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        _IdCart = ConvertType.ToInt(QueryHelper.GetQueryString(Request, ConstString._idcart));
        Component.Contact contact = ContactDB.GetObjectByIdCart(_IdCart, true);
        if (contact != null)
        {
           // this.txtEmail.Text = contact.Mail;
            _Session += "<br/> Tên khách hàng: " + contact.FullName + " <br/>Địa chỉ: " + contact.Address + " <br/>Số phone: " + contact.Phone + " <br/>Ngày liên hệ: " + contact.Date.ToShortDateString();
            DataBind(Cart_ProductDB.CartDetail(contact.Cart, true));
        }
        else
            _tableCart = "Lỗi load dữ liệu";
       
    }
    void DataBind(XPCollection<Cart_Product> al)
    {
        if (al != null)
        {
            foreach (Cart_Product cartPro in al)
            {
                _tableCart += " <tr><td>" +
                                     cartPro.Product.Name
                + "</td> <td>" +
                                    cartPro.Quantity
                + "</td></tr>";
            }
        }

    }
   
 

}
